package com.iplant.base.utils.annotation.join.multi;

import com.iplant.base.po.enums.DBEnumType;
import com.iplant.base.po.enums.DBSchemas;

import java.lang.reflect.Field;

public class DBJoinMultiValue {

    /**
     * 取值字段
     */
    public String Name = "";

    /**
     * 本表属性
     */
    public String MainTableField = "";

    /**
     * 表名
     */
    public String TableName = "";


    public DBSchemas Schemas = DBSchemas.Basic;

    /**
     * 数据库类型
     *
     * @return DBEnumType
     */
    public DBEnumType DBType = DBEnumType.MySQL;

    /**
     * 外键表字段
     */
    public String OutTableField = "ID";


    public DBJoinMultiValue(){}

    public Field MainField;


    public Field JoinViewField;


    public String GetFullTableName(){
      return  Schemas.getTBName(DBType ,TableName);
    }

    public DBJoinMultiValue(DBJoinMulti wDBJoinMulti, Field wViewField,Field wMainField){

        this.Name=wDBJoinMulti.Name();
        this.MainTableField=wDBJoinMulti.MainTableField();
        this.TableName=wDBJoinMulti.TableName();
        this.Schemas=wDBJoinMulti.Schemas();
        this.DBType=wDBJoinMulti.DBType();
        this.OutTableField=wDBJoinMulti.OutTableField();
        this.MainField=wMainField;
        this.JoinViewField=wViewField;


    }
}
